const mongoose = require("mongoose");
const Db = require("../index")
// 结构约束规则
const schema = new mongoose.Schema({
	// 微博内容
	context: {
		type: String,
		required: true,
		unique: true
	},
	// 顶的数量
	topNum: {
		type: Number,
		default: 0
	},
	// 踩的数量
	downNum: {
		type: Number,
		default: 0
	},
	// 增加的时间
	addTime: {
		type: String
	}
}, {
	versionKey: false
})
// model
const model = mongoose.model("contextList", schema, "contextList");
module.exports = new Db(model);